package com.alibaba.edas.assist.plugin.utils;

import java.io.File;

/**
 * Created by yingsy on 2020-10-21.
 */
public class Constants {
    public static final String BR_STR = "\r\n";
    public static final String HSF_SERVER_PORT_KEY = "hsf.server.port";
    public static final int HSF_SERVER_PORT_DEFAULT = 12200;
    public static final String PANDORA_QOS_PORT_KEY = "pandora.qos.port";
    public static final int PANDORA_QOS_PORT_DEFAULT = 12201;
    public static final String PANDORA_TMP_PATH_KEY = "com.taobao.pandora.tmp_path";
    public static final String CSP_PORT = "csp.port";
    public static final int CSP_PORT_DEFAULT = 8719;
    public static final String TOMCAT_MONITOR_PORT_KEY = "tomcat.monitor.http.port";
    public static final int TOMCAT_MONITOR_PORT_DEFAULT = 8006;
    public static final String CAI_ADDRESS = System.getProperty("address.server.domain", "jmenv.tbsite.net");
    public static final String CAI_ADDRESS_PORT = System.getProperty("address.server.port", "8080");
    public static final String EDAS_CONSOLE_ADDR = System.getProperty("edas.console.url");
    public static final String EDAS_CONSOLE_DEFAULT_ADDR = "http://edas-internal.console.aliyun.com";
    public static final boolean ISCAICHECK = Boolean.valueOf(System.getProperty("ISCAICHECK", "false"));
    public static final boolean APP_NAME_UNIQUE = Boolean.valueOf(System.getProperty("app.name.unique", "false"));
    public static final String USER_HOME = System.getProperty("user.home", "/home/admin");
    public static final String DAUTH_HOME;
    public static final String DAUTH_CONFIG_FILE;
    public static final String DAUTH_CONFIG_FILE_D;
    public static final String DAUTH_TENANT_ID_KEY;
    public static final String EDAS_NETWORK_FILE;
    public static final String CLUSTER_ENV_ID;
    public static final String MACHINE_UUID;
    public static final String BIZ_IP;
    public static final String PROJECT_NAME_KEY = "project.name";
    public static final String PROJECT_NAME;
    public static final String APP_NAME;
    public static final String APP_ID;
    public static final String APP_GROUP;
    public static final boolean EDAS_AUTO_REGISTER_ENABLE;
    public static final String HEADER_ACCESS_KEY = "X-EDAS-AccessKey";
    public static final String HEADER_SIGNATURE = "X-EDAS-Signature";
    public static final String API_ALIVE = "/v1/heartbeat/apiAlive";

    public Constants() {
    }

    static {
        DAUTH_HOME = USER_HOME + File.separator + ".spas_key";
        DAUTH_CONFIG_FILE = DAUTH_HOME + File.separator + "default";
        DAUTH_CONFIG_FILE_D = System.getProperty("spas.identity", DAUTH_CONFIG_FILE);
        DAUTH_TENANT_ID_KEY = System.getProperty("tenant.id");
        EDAS_NETWORK_FILE = System.getProperty("edas.network.file", "/opt/edas/network/ipaddr.conf");
        CLUSTER_ENV_ID = System.getProperty("cluster.env.id");
        MACHINE_UUID = System.getProperty("machine.uuid");
        BIZ_IP = System.getProperty("biz.ip");
        PROJECT_NAME = System.getProperty("project.name");
        APP_NAME = System.getProperty("app.name");
        APP_ID = System.getProperty("app.id");
        APP_GROUP = System.getProperty("app.group");
        EDAS_AUTO_REGISTER_ENABLE = Boolean.valueOf(System.getProperty("edas.auto.register.enable", "false"));
    }
}
